package com.bky.util;

import java.util.concurrent.ThreadFactory;

public class ExecutorThreadFactory implements ThreadFactory{
    private int count = 0;
    private String name;

    public ExecutorThreadFactory(String name) {
        this.name = name;
    }

    public Thread newThread(Runnable r) {
        Thread t = new Thread(r);
        t.setDaemon(true);
        t.setName(this.name + "Thread -" + this.count++);
        return t;
    }
}
